/**
 * 
 */
package com.crm.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.crm.common.base.BaseController;
import com.crm.common.bean.User;
import com.crm.common.constant.CommonConsts;
import com.crm.common.core.JsonResult;
import com.crm.service.IUserService;

/**
 * @author D
 *
 */
@Controller
@RequestMapping("/user")
public class UserController extends BaseController{
	private static final Logger LOGGER = LogManager.getLogger(UserController.class.getName());
	
	@Autowired
	private IUserService userService;
	
	@RequestMapping(value="/getUserMsg", method=RequestMethod.POST)
	@ResponseBody
	public JsonResult getUserMsg(){
		JsonResult json = new JsonResult();
		json.setCode(CommonConsts.REQ_SUCC);
		json.setMessage("获取成功");
		User user = userService.getUserMsg();
		json.setData(user);
		return json;
	}
	
	@RequestMapping(value="/getUserMsgVersion2", method=RequestMethod.POST)
	@ResponseBody
	public JsonResult getUserMsgVersion2(){
		JsonResult json = new JsonResult();
		json.setCode(CommonConsts.REQ_SUCC);
		json.setMessage("获取成功");
		User user = userService.getUserMsg();
		json.setData(user);
		return json;
	}

}
